﻿@using Microsoft.AspNetCore.Identity
@using src.Models

@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager


@if (SignInManager.IsSignedIn(User))
{
    ApplicationUser appUser = await UserManager.GetUserAsync(User);

    <li class="dropdown user user-menu">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <img src="../@appUser.ProfilePictureUrl" class="profile-picture user-image" alt="User Image">
            <span class="profile-fullName hidden-xs">@appUser.FullName</span>

        </a>
        <ul class="dropdown-menu">
            <!-- User image -->
            <li class="user-header">
                <img src="../@appUser.ProfilePictureUrl" class="profile-picture img-circle" alt="User Image">
                <p>
                    <span class="profile-fullName">@appUser.FullName</span>
                    @if (appUser.IsSuperAdmin)
                    {
                        <small>Super Admin.</small>

                    }
                    else if (appUser.IsCustomer)
                    {
                        <small>Customer Contact.</small>

                    }
                    else if (appUser.IsSupportAgent)
                    {

                        <small>Support Agent.</small>
                    }
                    else
                    {
                        <small>Support Engineer.</small>

                    }

                </p>
            </li>

            <!-- Menu Footer-->
            <li class="user-footer">
                <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm">
                    <div class="pull-left">
                        <a asp-controller="Config" asp-action="UserProfile" class="btn btn-default btn-flat">Profile</a>
                    </div>
                    <div class="pull-right">
                        <button type="submit" class="btn btn-default btn-flat">Log out</button>
                    </div>
                </form>

            </li>

        </ul>
    </li>


}

